package com.shijie.sjoj.web.controller;

import com.shijie.sjoj.model.api.quiz.QuizService;
import com.shijie.sjoj.model.pojo.entity.Quiz;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequiredArgsConstructor
public class QuizController {

    @DubboReference
    private final QuizService quizService;

    @GetMapping("/list")
    public List<Quiz> list(){
        List<Quiz> list = quizService.list();
        log.info(list.toString());
        return list;
    }


}
